package com.mycompany.myapp.service.mapper;

import com.mycompany.myapp.domain.UserRole;
import com.mycompany.myapp.service.dto.UserRoleDTO;
import java.util.Set;
import org.mapstruct.*;

/**
 * Mapper for the entity {@link UserRole} and its DTO {@link UserRoleDTO}.
 */
@Mapper(componentModel = "spring", uses = { TeacherMapper.class, StudentMapper.class })
public interface UserRoleMapper extends EntityMapper<UserRoleDTO, UserRole> {
    @Mapping(target = "teachers", source = "teachers", qualifiedByName = "idSet")
    @Mapping(target = "students", source = "students", qualifiedByName = "idSet")
    UserRoleDTO toDto(UserRole s);

    @Mapping(target = "removeTeacher", ignore = true)
    @Mapping(target = "removeStudent", ignore = true)
    UserRole toEntity(UserRoleDTO userRoleDTO);
}
